package cn.fenqing168.springcloud.feign;

import cn.fenqing168.springcloud.commons.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 库存服务的feign接口
 * @author fenqing
 */
@FeignClient(value = "seata-storage-service")
public interface FeignStorageService {

    /**
     * 减少库存
     * @param productId 产品idPost
     * @param count 减少的数量
     * @return 处理结果
     */
    @PostMapping("/storage/decrease")
    BaseResult<?> decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);

}
